# -*- coding: utf-8 -*-
# $ Time    :2022/6/30 9:54
# $ Author  :@柒筱暮
# $ GitHub  :https://github.com/Angie-co
# $ File    :settings.py

"""
配置项
"""
"""
请求数据
"""
# 请求的url
URL = f"https://club.jd.com/comment/productPageComments.action"

# 请求头
HEADERS = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
}

# 请求参数
PARAMS = {
    "callback": "fetchJSON_comment98",
    "productId": "100026667910",
    "score": "0",
    "sortType": "5",
    "page": "0",
    "pageSize": "10",
    "isShadowSku": "0",
    "rid": "0",
    "fold": "1"
}

# 请求页数
PAGES = 20

# 代理ip，注释则不使用代理ip
PROXIES = {
    "https": "https://119.123.175.200:9797"
}

"""
绘制词云图
"""
# 是否保存词频到CSV
WORDS_CSV = True

# 是否画词云图
IS_PAINTING = True

# 词云图c词数
WORDCOUNT = 20

# 字体路径
FONT_PATH = "./config/msyh.ttc"

# 词云图背景色
COLOR = "white"

# 词云蒙版
BACKGROUND = "./img.jpg"

# 词云图路径
IMG = "词云图.png"


"""
保存至csv文件
"""
# 是否保存到CSV
ISTO_CSV = True

# csv文件路径
CSV_PATH = "AppleIphone13销售数据.csv"

"""
保存至MongoDB数据库
"""
# 是否保存到Mongo
ISTO_MONGO = True

# Mongo主机地址
MONGO_HOST = "localhost"

# Mongo端口号
MONGO_PORT = 27017

# 保存到的MongoDB数据库
MONGO_DATABASE = "JD_commodity"

# 保存到的MongoDB数据库集合
MONGO_COLLECTIONS = "iPhone_13"


